<?php
/**
 * Created by JetBrains PhpStorm.
 * User: ICT
 * Date: 5/8/13
 * Time: 11:23 AM
 * To change this template use File | Settings | File Templates.
 */
$title = 'My albums';
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml("test"); ?></h1>
<p>
    <a href="<?php echo $this->url('album', array('action'=>'add'));?>">Add new album</a>
</p>

<table class="table">
    <tr>
        <th>Title</th>
        <th>Artist</th>
        <th>&nbsp;</th>
    </tr>
    <?php foreach ($this->paginator as $album) : ?>
        <tr>
            <td><?php echo $this->escapeHtml($album->title);?></td>
            <td><?php echo $this->escapeHtml($album->artist);?></td>
            <td>
                <a href="<?php echo $this->url('album',
                    array('action'=>'edit', 'id' => $album->id));?>">Edit</a>
                <a href="<?php echo $this->url('album',
                    array('action'=>'delete', 'id' => $album->id));?>">Delete</a>
            </td>
        </tr>
    <?php endforeach; ?>
</table>
<?php // add at the end of the file after the table
echo $this->paginationControl(
// the paginator object
    $this->paginator,
    // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
    'sliding',
    // the partial to use to render the control
    array('partial/paginator.phtml', 'Album'),
    // the route to link to when a user clicks a control link
    array(
        'route' => 'album'
    )
);
?>